//
//  MKClassifyTableViewCell.m
//  ManKeCartoon
//
//  Created by dllo on 15/10/20.
//  Copyright © 2015年 ManKe. All rights reserved.
//

#import "MKClassifyTableViewCell.h"

@implementation MKClassifyTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self classes];
    }
    return self;
}

-(void)classes
{
    self.classifyImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15, 9, 90, 120)];
    
    [self.contentView addSubview:self.classifyImageV];
    
    self.title = [[UILabel alloc] initWithFrame:CGRectMake(120*WIDTH, 10*HEIGHT, 200*WIDTH, 40*HEIGHT)];
    [self.title setTextColor:[UIColor blackColor]];
    [self.title setFont:[UIFont systemFontOfSize:18]];
    [self.contentView addSubview:_title];
    
    self.lastup  = [[UILabel alloc] initWithFrame:CGRectMake(120*WIDTH, 35*HEIGHT, 200*WIDTH, 40*HEIGHT)];
    [self.lastup setTextColor:[UIColor blackColor]];
    [self.lastup setFont:[UIFont systemFontOfSize:13]];
    [self.contentView addSubview:_lastup];
    
    self.type = [[UILabel alloc] initWithFrame:CGRectMake(120*WIDTH, 55*HEIGHT, 200*WIDTH, 40*HEIGHT)];
    [_type setTextColor:[UIColor blackColor]];
    [_type setFont:[UIFont systemFontOfSize:13]];
    [self.contentView addSubview:_type];
    
    self.brief_intrd = [[UILabel alloc] initWithFrame:CGRectMake(120*WIDTH, 85*HEIGHT, 200*WIDTH, 40*HEIGHT)];
    [_brief_intrd setTextColor:[UIColor grayColor]];
    [_brief_intrd setFont:[UIFont systemFontOfSize:15]];
    [self.contentView addSubview:_brief_intrd];

}

-(void)getCell:(MKChartsModel *)model row:(NSInteger)row
{
    self.title.text = model.title;
    
    self.lastup.text = model.lastup;
    
    self.type.text = model.type;
    
    self.brief_intrd.text = model.brief_intrd;

    NSURL *url = [NSURL URLWithString:model.cover_url];
    
    [self.classifyImageV sd_setImageWithURL:url];

}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
